using System;
using Microsoft.SPOT;
using Gadgeteer.Modules.GHIElectronics;
using Gadgeteer.Interfaces.Led;

namespace Gadgeteer.Interfaces.GHI.Btn
{
    internal class ButtonLedWrapper : IToggleLed
    {
        private readonly Button button;

        public ButtonLedWrapper(Button button)
        {
            if (button == null) throw new ArgumentNullException("button");
            this.button = button;
        }

        public void TurnOn()
        {
            button.TurnLEDOn();
        }

        public bool IsTurnedOn
        {
            get { return button.IsLedOn; }
        }

        public void TurnOff()
        {
            button.TurnLEDOff();
        }
    }
}
